UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G8A/kN13irPz9hgzABtyHloZKyd+lSxONaTZxU6aP/Q='
WHERE
key_id = '681cf5fc0ff6a5f094b681fdb192b28c69f18e95a833617d2798ebde51f500c5'
AND (
token = 'G8A/kN13irPz9hgzABtyHloZKyd+lSxONaTZxU6aP/Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)