UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YkVIo20Yq3bsogsGfMAO0JV7yvSlxLxfETnUQsc427k='
WHERE
key_id = '60ad2fbc122a9fc654d2da5a6b73a9df1c6af94d63fe750132191e35c3aaff50'
AND (
token = 'YkVIo20Yq3bsogsGfMAO0JV7yvSlxLxfETnUQsc427k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)