UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ri+po9Zetv+/g/QGXH7GSMhHnGdq10i90BNgK0iQcVE='
WHERE
key_id = 'e109d4f3bfc7005b563c67cff70e6132dcfc478413bb196051118a70d5857707'
AND (
token = 'Ri+po9Zetv+/g/QGXH7GSMhHnGdq10i90BNgK0iQcVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)