UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Od3m3pNEZWLhb1jAO5kIsqredbagvJkXjQ5hR8v6sdE=' 
WHERE 
  key_id = '25b7a70a971a6c934aee4eaf6faab06ad371b324a3870c53b3632e4fcd755a72' 
  AND (
    token = 'Od3m3pNEZWLhb1jAO5kIsqredbagvJkXjQ5hR8v6sdE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032