UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8iy5NfATw8Kqr/pnIAmEO7AaZQ05SKmaeDUXL+afhnU=' 
WHERE 
  key_id = '624dc3224d858ba5ea68260e809244ad288d8f0bb8ae1e6ce597fa5ac754744c' 
  AND (
    token = '8iy5NfATw8Kqr/pnIAmEO7AaZQ05SKmaeDUXL+afhnU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045