UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M+C16mHAxlPYsgbuG9476CFaFscT1zlzEzE3VHHj2X4='
WHERE
key_id = '9234cccdf71d8d3a9dda0654035e042ff45dac80695f019429e8bf93c5308640'
AND (
token = 'M+C16mHAxlPYsgbuG9476CFaFscT1zlzEzE3VHHj2X4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)