UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cEfrZa0w/cF8ywKUuBxIaQRuthRnqMUG0syz0aawArU=' 
WHERE 
  key_id = '951d44ec28a79de9af5d186b4fa252cd99b59ebd9d301df6bf5d00fbcb1c7ca7' 
  AND (
    token = 'cEfrZa0w/cF8ywKUuBxIaQRuthRnqMUG0syz0aawArU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021