UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LppQU+4IMU6UBaexvSeOSCm4wgNDfGvcWzcDuD2mDgM='
WHERE
key_id = '65bbe3bd9be5547f8a92c676cd21e383f3883b61a073cc52f4050b85eb019740'
AND (
token = 'LppQU+4IMU6UBaexvSeOSCm4wgNDfGvcWzcDuD2mDgM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)