UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZoIQnGaCUA+rDeYOAbkmZw3a7PGLaMrY/yj/cMmPjzA='
WHERE
key_id = 'da68a8d9df9fd5f943765cae0002b59f692ac9af0171954ebce1ed44e9eef813'
AND (
token = 'ZoIQnGaCUA+rDeYOAbkmZw3a7PGLaMrY/yj/cMmPjzA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)