UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RIKTSSj6IDojTTOHsGxRaDq/v7KeuKYDM6QLDHBPVgc='
WHERE
key_id = 'cc7383186e088285873e85e8a69d6f32024c4ab4a041ce77dbdd354e6dda584e'
AND (
token = 'RIKTSSj6IDojTTOHsGxRaDq/v7KeuKYDM6QLDHBPVgc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)