UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KRMnxF55NxYtbt/rH+jdi++/RujRMBWbyZMFaYOAAsk=' 
WHERE 
  key_id = '61b363224eb498589d90b4c3aaa0662b46f2fad8a6ab6330f11d3920f82684c2' 
  AND (
    token = 'KRMnxF55NxYtbt/rH+jdi++/RujRMBWbyZMFaYOAAsk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050