UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M7v3EvwnYwmkOoIf4JT9uk3DX5939w6WcKZ6b0l490o=' 
WHERE 
  key_id = '97f0103beb082caf43f8dfc6880f671a63d31eca81e78ef33e938c6ec549e657' 
  AND (
    token = 'M7v3EvwnYwmkOoIf4JT9uk3DX5939w6WcKZ6b0l490o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025