UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0i0/re4+VtOJmhexNK7V+FLjYFizKRVZ5S5atiJ8OXc=' 
WHERE 
  key_id = '81a9d14ec4434e652b50ade692d5b9d55b292bab609e5b0dc2ab90c2e2eaa95d' 
  AND (
    token = '0i0/re4+VtOJmhexNK7V+FLjYFizKRVZ5S5atiJ8OXc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031