UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TuwqiBRj9hjgbuGV16qHb4zsxsnLV4jtnO/CuOhLhEA='
WHERE
key_id = 'bf1001c2f0619749b40d1f221b1612b95c5734d1581b94ec570c27787cdb23f9'
AND (
token = 'TuwqiBRj9hjgbuGV16qHb4zsxsnLV4jtnO/CuOhLhEA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)