UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mdz7pP//3SvqJoiguroJm2WSDr/2DzBl1NT/2waNZMU='
WHERE
key_id = 'b0fd89448ddf1a0a6cbe1fda149625bd5361fe984e7d8df46a1786c757bef261'
AND (
token = 'Mdz7pP//3SvqJoiguroJm2WSDr/2DzBl1NT/2waNZMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)