UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K0qyA5pYAh3UzS20xjv+GbFsvKjpDns3u9eqjBUXJjw='
WHERE
key_id = '32231eedbdfa31bf84525264edc98ed03c9f82ab375c138bbc154798a4f30ab3'
AND (
token = 'K0qyA5pYAh3UzS20xjv+GbFsvKjpDns3u9eqjBUXJjw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)