UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+wHORE0rY3SE7w1q2uCIEZE+doLyH9V+ygLLjC6PUjg='
WHERE
key_id = '5f853eec33dec41f31b302951cb6dae43e96c54de893366e85a5f53361089de0'
AND (
token = '+wHORE0rY3SE7w1q2uCIEZE+doLyH9V+ygLLjC6PUjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)