UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5jmpkrilJzKG/OdWewEgDQQ9deGNn1a6R8Cdw2tOJr4=' 
WHERE 
  key_id = '370543b68f2595cd0619fac4b3086db3b708fbed31c08dffe0a84bd869ce0b09' 
  AND (
    token = '5jmpkrilJzKG/OdWewEgDQQ9deGNn1a6R8Cdw2tOJr4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035