UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WgNEutsmr5rBlHoG5TMgoAffBgoZRTSY1mdsZFvVGn4='
WHERE
key_id = '342b91a6d09cd9acc9ead0433571041829d3728e36f89e0f542f9fd5489635c7'
AND (
token = 'WgNEutsmr5rBlHoG5TMgoAffBgoZRTSY1mdsZFvVGn4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)