UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9N9gZXZz11iuwcmtGF8Rmj1Bjsb4LlATGDxsHBtn7Kg='
WHERE
key_id = 'b4042db60cdcec68867f78f2c8e449da36232db69133127532894edebbde1428'
AND (
token = '9N9gZXZz11iuwcmtGF8Rmj1Bjsb4LlATGDxsHBtn7Kg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)