UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8c1k3mKyvBA99mkZwCXw2qZyJgKxw6gdQ/Y8rkQZT5o=' 
WHERE 
  key_id = '85ae981779629f5057f07cbf59746ae38b0965c6183c2103ffb2bfd3d197e83d' 
  AND (
    token = '8c1k3mKyvBA99mkZwCXw2qZyJgKxw6gdQ/Y8rkQZT5o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026