UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZoqfFPClzIjU8FoUckKxk18+yd/g4fyva1FFwMW46go='
WHERE
key_id = '5b2e3046596d5fff9aab4041bb43c8af06d192b6d4bf6d465b32588f70341858'
AND (
token = 'ZoqfFPClzIjU8FoUckKxk18+yd/g4fyva1FFwMW46go='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)