UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XeEt4RciF9v6FkT9lmSI+SleA8NYISqvhM9cpelIyYQ='
WHERE
key_id = 'dcacf106bcb59eb0bf25f502a12dd387ed91a1dfaeaf5085979697343727e0e3'
AND (
token = 'XeEt4RciF9v6FkT9lmSI+SleA8NYISqvhM9cpelIyYQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)