UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YdnAFJOzyAzbPwAp30306wR6a5v4/5B0d7tnCQdkpzY='
WHERE
key_id = '025c1ce029714b1320eb2ba9428db88f87ca4dea4eb413460f5e0d55f78d9924'
AND (
token = 'YdnAFJOzyAzbPwAp30306wR6a5v4/5B0d7tnCQdkpzY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)