UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eT9p3NfstLNvrF1M+4Bc+zYzUYGtlG14sWMlKSqWwvw=' 
WHERE 
  key_id = '437b5b4413eaf1d0dbb85593eb49b433bee8de80fbc9240c019b2b966cc8609a' 
  AND (
    token = 'eT9p3NfstLNvrF1M+4Bc+zYzUYGtlG14sWMlKSqWwvw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016