UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6tkyQt2CZKRauC37wHsBtRUy4KDh+8lzbwwi2rOIF/8=' 
WHERE 
  key_id = 'e8ea6ac98e4bb5ed0e11eb1d7c6674251b05e862e2d28b38c29c66411d234971' 
  AND (
    token = '6tkyQt2CZKRauC37wHsBtRUy4KDh+8lzbwwi2rOIF/8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028