UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/MWuPIel+Px1hq8Dqoe8lhUW5xvMXo1ypnfVV0uQRmw='
WHERE
key_id = '89ebce031904f4cca2f963c05150d1a5c3f6ac9401c4cca9501c6f01e5082219'
AND (
token = '/MWuPIel+Px1hq8Dqoe8lhUW5xvMXo1ypnfVV0uQRmw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)