UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LMQ2dlfyIP4mfDWdw5/0/Q6Wpk0ukQE7KjFhc51zdv8=' 
WHERE 
  key_id = '376704bcdb6ec6923167021b3546c9350db0f31fc583f0afc5ea4f96f118689c' 
  AND (
    token = 'LMQ2dlfyIP4mfDWdw5/0/Q6Wpk0ukQE7KjFhc51zdv8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037