UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '64ZANJFBpu3kM3LdlF35aGd0EGobcAd6rOvlZ/NKCsY='
WHERE
key_id = '1ca3438a44fbf8f48e906fcfd4dff4b99382df4414ef31788289d0710ecb109c'
AND (
token = '64ZANJFBpu3kM3LdlF35aGd0EGobcAd6rOvlZ/NKCsY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)