UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VNt+AhbPVYhBQlBNoF5QN2SdppSQoW/zl2YasaAPbrI='
WHERE
key_id = 'd0fc00edcfc81b51091d51117bcab0db4304d7dc9e5c5216d36ccffcd6be11ce'
AND (
token = 'VNt+AhbPVYhBQlBNoF5QN2SdppSQoW/zl2YasaAPbrI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)