UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '31HFBWVAcsH8yOtWLoPYbwLy15iGrqdHvSnJMgswChs='
WHERE
key_id = 'b85e465c36e16f7275ba502bb2b9c7828f0a105420ed474a5ae72e1cc42bd3c3'
AND (
token = '31HFBWVAcsH8yOtWLoPYbwLy15iGrqdHvSnJMgswChs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)