UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fJrQ0APr8h/ZmDOaiJzLFP4sA+1+EU9sriYHF58VxSk=' 
WHERE 
  key_id = '8411ba099f4ae2d0d4a869e15794c35965bcc330fff9161647a2e48f0c322768' 
  AND (
    token = 'fJrQ0APr8h/ZmDOaiJzLFP4sA+1+EU9sriYHF58VxSk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028