UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QF96kBMD8AkkPrrsQHBOI5ecPP9brVs5IXk6r9usVfM='
WHERE
key_id = 'acb37fdc675fc928594fbd621ae92a581c9b951791717e259c3a2dfc2b559b64'
AND (
token = 'QF96kBMD8AkkPrrsQHBOI5ecPP9brVs5IXk6r9usVfM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)