UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JIdoF8yIX2R69JX39/nqTibxwiUG/Nq1hh50hyJECWE=' 
WHERE 
  key_id = 'c7573baf0af0e8332714dbbc51eea3ef126ba88524799e0fafec93f3e37187fc' 
  AND (
    token = 'JIdoF8yIX2R69JX39/nqTibxwiUG/Nq1hh50hyJECWE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021