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