UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bBYtZiTFUALXpkRdoh+qC2ifZcMTgr8nkLiIRwnrmUU='
WHERE
key_id = '55c9b28a29f73ac9a5683446511fa24dcf78ba62a5b6eefd3a457deff091ebfa'
AND (
token = 'bBYtZiTFUALXpkRdoh+qC2ifZcMTgr8nkLiIRwnrmUU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)