UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HZPmJ6z16mcubvwko2T4hXsxnmZoC3XdOkc9wCws80c=' 
WHERE 
  key_id = '0d84bb8464632bae7033d982b05205ceb41707084eeae3ee0f9e3afcdac08aab' 
  AND (
    token = 'HZPmJ6z16mcubvwko2T4hXsxnmZoC3XdOkc9wCws80c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031