UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0FbJSQjHU6ThibgLDe/byNWEka1lLwBO3HMm3xp3xkg=' 
WHERE 
  key_id = '68622b0c580f3491872d210673976c63590db3982ecf9fcc405806ff3ac40013' 
  AND (
    token = '0FbJSQjHU6ThibgLDe/byNWEka1lLwBO3HMm3xp3xkg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046