UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7f1x1uDy6x/PQ6hIo7nV2AgZiD+CmqH28HkNvhQESh0=' 
WHERE 
  key_id = '0ea5a539813947b9127303ecedff183501144a08fc24d961f6a2ca11579c54c1' 
  AND (
    token = '7f1x1uDy6x/PQ6hIo7nV2AgZiD+CmqH28HkNvhQESh0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030