UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1tHVpCeQ3RvSnaW6tVl86FiN3hZOxfUIKtUmVyeAA2w='
WHERE
key_id = 'de444253dcac4305ce14728faa6a4bfbdf6a35910f8f4c128e4acae6e673e223'
AND (
token = '1tHVpCeQ3RvSnaW6tVl86FiN3hZOxfUIKtUmVyeAA2w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)