UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UA9jF4ThkzIui0uyrVDHnuyhM7KY49TB6MS64Js96zo=' 
WHERE 
  key_id = 'f838b6b4cfef75af17fbed0199a4d5c03832ec84284a7f339cbc340a8c5a9d40' 
  AND (
    token = 'UA9jF4ThkzIui0uyrVDHnuyhM7KY49TB6MS64Js96zo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047