UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3MCVm0i1rqtmqEIZ/Sq4Zqpo9Ib6OrFXatMq512pMXk='
WHERE
key_id = '56e79ece3a874c007c39d405dee9528b17c540289c2b386e770a806fa858ec2d'
AND (
token = '3MCVm0i1rqtmqEIZ/Sq4Zqpo9Ib6OrFXatMq512pMXk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)