UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QxQb8J4hTwBsPG5+tle7fpJ6Nxud+KvgqVC0tkicOpM='
WHERE
key_id = '98887783299ad4d7fd29737cffc9ce291dad963d8132dcced3fabffb3294d065'
AND (
token = 'QxQb8J4hTwBsPG5+tle7fpJ6Nxud+KvgqVC0tkicOpM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)