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