UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5uqnjeg6+fG1CZihic6lby+hOFcyGMCEqahBF4wQcYQ='
WHERE
key_id = '16b2702bedb7555542ccae4abee70061befa72c1f8cbceb2a777f3b096ec7a12'
AND (
token = '5uqnjeg6+fG1CZihic6lby+hOFcyGMCEqahBF4wQcYQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)