UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9/A42oqbWaGAl15aHHAetGFWeClsH/WVcrHc45/qwfU='
WHERE
key_id = 'f6c80fc741d2ce4b4b8422f6d5f80a695147855b9ddce7e80bcd8cbd3f63665d'
AND (
token = '9/A42oqbWaGAl15aHHAetGFWeClsH/WVcrHc45/qwfU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)