UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dg72gVxDElDjv+65/ZnvEmRNwn2sYHaRLz/3ARdL+JY='
WHERE
key_id = 'd3035981b450d48216c836658e785fd9c2bd054b61ef68ed7fbe72aacc6ebcd8'
AND (
token = 'Dg72gVxDElDjv+65/ZnvEmRNwn2sYHaRLz/3ARdL+JY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)