UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zWYZtpxuztAoDw8AquFWAuAKPtOszkOJsGDynvgpdaY='
WHERE
key_id = '3d7e7338fdcb2beef96cbe5f560dfd56cf1877865e28b1ad7877e42218f727a1'
AND (
token = 'zWYZtpxuztAoDw8AquFWAuAKPtOszkOJsGDynvgpdaY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)