UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2PmMWDM+l5ywHOsJ8B/SCuvv7V7OKtFs5FJliFK+7ls=' 
WHERE 
  key_id = '4daed5829fde86caa2de20226a61db2835bac994b9a367a311766d08c9b6309b' 
  AND (
    token = '2PmMWDM+l5ywHOsJ8B/SCuvv7V7OKtFs5FJliFK+7ls=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017