UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FPZ32ubCE/Q17K5hDouqpgB+LVdm4YJARWFj1XoJnI4='
WHERE
key_id = '33c9ef83350b539323d749e618f033e2d7b3e0df6145865111cd918586222f23'
AND (
token = 'FPZ32ubCE/Q17K5hDouqpgB+LVdm4YJARWFj1XoJnI4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)