UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7nUqOZ6PuzGZwhiRykeMgrgotr76ZYAXf6bN9MFX4XY='
WHERE
key_id = '5d873cc06042f793e3d7fd3cbf6986bfbe8fa2678e491aaea691f58510d7bd4e'
AND (
token = '7nUqOZ6PuzGZwhiRykeMgrgotr76ZYAXf6bN9MFX4XY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)