UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/bthiJzQbM3UQlaCfIM/fuhYw/W/Jfb44+ilbFv9DoA='
WHERE
key_id = '9e48291650d1904a03399ca76ac376818aa14e7cfeeeca9914e2481eb0a77d44'
AND (
token = '/bthiJzQbM3UQlaCfIM/fuhYw/W/Jfb44+ilbFv9DoA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)