UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TPQFfIQjYkDuzhaBJfKYwcFPelFUoqcvXp5sIIy0EKE='
WHERE
key_id = '4c6f5fd3b9555003a5292054b46dd22af419c2ee2053dc5c66371b4042bdfe85'
AND (
token = 'TPQFfIQjYkDuzhaBJfKYwcFPelFUoqcvXp5sIIy0EKE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)