UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xjt2Y+TSdZzjcd6eCnB6gajbPasweoEbq6veifRFKAs='
WHERE
key_id = '46b33598b63223f84b4318e90cf2b2b62771188245b04ef66fa690b416574bcc'
AND (
token = 'xjt2Y+TSdZzjcd6eCnB6gajbPasweoEbq6veifRFKAs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)